<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/test', "ArticleController@test");

Route::get('/createDict', function () {
    $path = base_path().'/storage/dict.txt';
    dd((new \App\Service\BlackWord())->createDict($path));

});

Route::get('/', function () {
   /* $str = '哈哈哈你是煞笔啊';
    $result = (new \App\Service\BlackWord())->searchReplace($str);
    dd($result);*/
});


//微信路由
Route::any('/wechat', 'WeChatController@serve');


Route::group(['middleware' => ['web'], 'prefix'=>'api'], function ($router) {
    //获取seesion
    $router->post('/getSerSession', 'PublicController@getSerSession');
    //检车3rd_sessioin是否失效
    $router->post('/checkSession', 'PublicController@checkSession');
    $router->post('/txNotice', 'PublicController@txNotice');

    //获取内容转发图片
    $router->get('/getImage', 'ArticleController@getImage');
});

//带session验证
Route::group(['middleware' => ['web', 'wechat.oauth'], 'prefix'=>'api'], function ($router) {
    //用户注册
    $router->post('/register', 'PublicController@register');
    //获取jssdk
    $router->post('/getJssdk', 'PublicController@getJssdk');
    //获取分类列表
    $router->post('/getCate', 'CategoryController@getList');
    //获取文章视频列表
    $router->post('/getList', 'ArticleController@getList');
    //增加视频浏览量
    $router->post('/addViews', 'ArticleController@addViews');
    //添加收藏
    $router->post('/addCollect', 'ArticleController@addCollect');
    //删除收藏
    $router->post('/delCollect', 'ArticleController@delCollect');
    //获取收藏
    $router->post('/getCollect', 'ArticleController@getCollect');
    //获取文章观看倒计时
    $router->post('/djs', 'ArticleController@djs');
    //增加签到
    $router->post('/addCheckIn', 'TaskController@checkIn');
    //增加邀请记录
    $router->post('/addInvite', 'TaskController@invite');
    //观看视频记录
    $router->post('/viewVideo', 'TaskController@viewVideo');
    //分享视频记录
    $router->post('/shared', 'TaskController@shared');
    //分享签到记录
    $router->post('/shareCheckIn', 'TaskController@shareCheckIn');
    //分享小程序
    $router->post('/sharedMini', 'TaskController@sharedMini');
    //分享好友观看
    $router->post('/sharedFriends' , 'TaskController@sharedFriends');
    //邀请注册
    $router->post('/inviteShare', 'TaskController@inviteShare');
    //获取活动
    $router->post('/getActivity' , 'ActivityController@index');
    //获取用户信息
    $router->post('/getUserInfo' , 'MemberController@getUserInfo');
    //获取下级列表
    $router->post('/getChildren', 'MemberController@getChildren');
    //提现申请
    $router->post('/applyCash', 'MemberController@applyCash');
    //获取提现列表
    $router->post('/getTiCash', 'MemberController@getTiCash');
    //获取今日收益
    $router->post('/getSy', 'MemberController@getSy');
    //获取任务列表
    $router->post('/getTask', 'PublicController@getTask');
    //今日推荐
    $router->post('/recommend', 'CategoryController@recommend');
    //试玩任务
    $router->post('/demoplay', 'TaskController@demoPlay');
    //视频弹框
    $router->post('/alertTaskConfig', 'TaskController@alertTaskConfig');
    //访问记录
    $router->post('/getTodayLogin', 'PublicController@getTodayLogin');
    //增加评论
    $router->post('/addComment', 'ArticleController@addComment');
    //文章详情
    $router->post('/getDetail', 'ArticleController@getDetail');
    //评论点赞
    $router->post('/comTags', 'ArticleController@comTags');
    //文章点赞
    $router->post('/artTags', 'ArticleController@artTags');
    //删除评论
    $router->post('/delComment', 'ArticleController@delComment');
});


